package com.young.ums.model;

import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
* 用户信息实体类
* Created by imrookie on 2018-9-11.
*/
public class User extends AuthorityParameter {

    private String id;//主键
    private String name;//姓名
    private String account;//账号
    private String password;//密码
    private Date birthday;//出生日期
    private Integer sex;//性别
    private String tel;//电话
    private String email;//邮箱
    private Integer state;//状态
    private String remark;//备注
    private Integer num;//显示顺序
    private String header;//头像
    private String companyId;//所属单位
    private String companyName;//所属单位名称
    private Date lastLoginTime;//上次登录时间
    private Date thisLoginTime;//这次登录时间
    private String category;//用户类别
    private Date createTime;//创建时间
    private Date createTime2;//创建时间,按时间检索时作为结束时间使用
    private Date updateTime;//修改时间
    private Integer trashFlag;//删除标识

    private String orderBy;//排序字段
    private String orderType;//排序类型,升序asc/降序desc

    private String token;//sso认证令牌

    private String nodeType = "USER";//节点类型,供前端树插件使用



    public User(){
        super();
    }

    /**
     * 转化为user传输对象
     * @return
     */
    public com.young.interfaces.ums.model.User convert2User(){
        com.young.interfaces.ums.model.User userDto = new  com.young.interfaces.ums.model.User();
        BeanUtils.copyProperties(this, userDto);
        return userDto;
    }

    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", account='" + account + '\'' +
                ", birthday=" + birthday +
                ", sex=" + sex +
                ", tel='" + tel + '\'' +
                ", email='" + email + '\'' +
                ", state=" + state +
                ", remark='" + remark + '\'' +
                ", num=" + num +
                ", header='" + header + '\'' +
                ", companyId='" + companyId + '\'' +
                ", lastLoginTime=" + lastLoginTime +
                ", thisLoginTime=" + thisLoginTime +
                ", category='" + category + '\'' +
                ", createTime=" + createTime +
                ", createTime2=" + createTime2 +
                ", updateTime=" + updateTime +
                ", trashFlag=" + trashFlag +
                ", orderBy='" + orderBy + '\'' +
                ", orderType='" + orderType + '\'' +
                ", token='" + token + '\'' +
                '}';
    }

    public String getId() {
    return id;
    }
    public void setId(String id) {
    this.id = id;
    }
    public String getName() {
    return name;
    }
    public void setName(String name) {
    this.name = name;
    }
    public String getAccount() {
    return account;
    }
    public void setAccount(String account) {
    this.account = account;
    }
    public String getPassword() {
    return password;
    }
    public void setPassword(String password) {
    this.password = password;
    }
    public Date getBirthday() {
    return birthday;
    }
    public void setBirthday(Date birthday) {
    this.birthday = birthday;
    }
    public Integer getSex() {
    return sex;
    }
    public void setSex(Integer sex) {
    this.sex = sex;
    }
    public String getTel() {
    return tel;
    }
    public void setTel(String tel) {
    this.tel = tel;
    }
    public String getEmail() {
    return email;
    }
    public void setEmail(String email) {
    this.email = email;
    }
    public Integer getState() {
    return state;
    }
    public void setState(Integer state) {
    this.state = state;
    }
    public String getRemark() {
    return remark;
    }
    public void setRemark(String remark) {
    this.remark = remark;
    }
    public Integer getNum() {
    return num;
    }
    public void setNum(Integer num) {
    this.num = num;
    }
    public String getHeader() {
    return header;
    }
    public void setHeader(String header) {
    this.header = header;
    }
    public String getCompanyId() {
    return companyId;
    }
    public void setCompanyId(String companyId) {
    this.companyId = companyId;
    }
    public Date getLastLoginTime() {
    return lastLoginTime;
    }
    public void setLastLoginTime(Date lastLoginTime) {
    this.lastLoginTime = lastLoginTime;
    }
    public Date getThisLoginTime() {
    return thisLoginTime;
    }
    public void setThisLoginTime(Date thisLoginTime) {
    this.thisLoginTime = thisLoginTime;
    }
    public String getCategory() {
    return category;
    }
    public void setCategory(String category) {
    this.category = category;
    }
    public Date getCreateTime() {
    return createTime;
    }
    public void setCreateTime(Date createTime) {
    this.createTime = createTime;
    }
    public Date getCreateTime2() {
    return createTime2;
    }
    public void setCreateTime2(Date createTime2) {
    this.createTime2 = createTime2;
    }
    public Date getUpdateTime() {
    return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
    }
    public Integer getTrashFlag() {
    return trashFlag;
    }
    public void setTrashFlag(Integer trashFlag) {
    this.trashFlag = trashFlag;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getNodeType() {
        return nodeType;
    }

    public void setNodeType(String nodeType) {
        this.nodeType = nodeType;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

}